package com.zds.util;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @className:JedisConnectFacotory
 * @date: 2025/2/8 下午5:56
 * @description:
 */
public class JedisConnectFactory {
    private static final JedisPool jedisPool;
    static {
        JedisPoolConfig poolConfig = new JedisPoolConfig();
        poolConfig.setMaxIdle(10);//最大空闲连接
        poolConfig.setMaxTotal(10);//最大连接
        poolConfig.setMinIdle(1);
        jedisPool = new JedisPool(poolConfig,"192.168.31.102",6379,1000,"123456");

    }
    public static Jedis getJedisPool() {
        return jedisPool.getResource();
    }
}
